package cn.kasa.controller;

import cn.kasa.entity.User;
import cn.kasa.feign.UserFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PayController {
    @Autowired
    private UserFeign userFeign;

    @GetMapping("/getUserById/{id}")
    public User getUserById(@PathVariable Long id){

        // 调用getForObject方法发get请求
        return userFeign.getUserById(id);
    }
}
